package com.cn.longdistancebusstation.util;

import java.math.BigDecimal;

/**
 * Created by mucheng on 2018/4/23.
 */

public class ToolUtil {

    public static String fen2Yuan(String fen){
        BigDecimal fenValue = new BigDecimal(fen);
        BigDecimal yuanValue=fenValue.divide(new BigDecimal(100));
        yuanValue = yuanValue.setScale(2);
        return yuanValue.toString();
    }

    public static String yuan2Fen(String yuan){
        BigDecimal yuanValue = new BigDecimal(yuan);
        BigDecimal fenValue=yuanValue.multiply(new BigDecimal(100));
        fenValue = fenValue.setScale(0);
        return fenValue.toString();
    }

}
